/*
 * @Description:
 * @Author: HM
 * @Email: ming@cpglobalinnovation.com
 * @Date: 2025-02-08 12:04:52
 * @LastEditTime: 2025-02-12 15:14:49
 */
/*
 * Copyright (c) 2024 YuJie Ge(Smile)
 * Licensed under the MIT License.
 */
import { createRoot } from "react-dom/client";
import "@arco-design/web-react/dist/css/arco.css";
import "./i18n";
import "./index.css";
import Router from "./router";
import { createWeb3Modal, defaultWagmiConfig } from "@web3modal/wagmi/react";

import { WagmiConfig } from "wagmi";
import {
  arbitrum,
  avalanche,
  bsc,
  fantom,
  gnosis,
  mainnet,
  optimism,
  polygon,
} from "wagmi/chains";

const chains = [
  mainnet,
  polygon,
  avalanche,
  arbitrum,
  bsc,
  optimism,
  gnosis,
  fantom,
];
const MORALIS_API_KEY = import.meta.env.MORALIS_API_KEY;

// 1. Get projectID at https://cloud.walletconnect.com
const projectId = import.meta.env.VITE_PROJECT_ID || "";

const metadata = {
  name: "React Starter Template",
  description: "A React starter template with Web3Modal v3 + Wagmi",
  url: "https://web3modal.com",
  icons: ["https://avatars.githubusercontent.com/u/37784886"],
};

const wagmiConfig = defaultWagmiConfig({ chains, projectId, metadata });

createWeb3Modal({ wagmiConfig, projectId, chains });

createRoot(document.getElementById("root")!).render(
  <WagmiConfig config={wagmiConfig}>
    <Router />
  </WagmiConfig>
);
